package org.rslai.tcedit.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.hibernate.validator.Length;

/**
 * 版本信息
 * 
 * @author rslai
 */
@Entity
@Table(name="t_version")
public class Version extends UUIDSupport {

	private Product product; // 产品
	private String name; // 版本名 
	private String describing; // 版本描述

	@OneToOne
	@JoinColumn(nullable = false, updatable = false, unique = false)
    public Product getProduct() { return product; }
    public void setProduct(Product product) { this.product = product; }

	@Column(nullable = false, length = 50)
	@Length(max = 50, message = "版本名请限制在50字以内")
	public String getName() { return name; }
	public void setName(String name) { this.name = name; }

	@Column(nullable = true, length = 100)
	@Length(max = 100, message = "版本描述请限制在100字以内")
	public String getDescribing() { return describing; }
	public void setDescribing(String describing) { this.describing = describing; }

//		INSERT INTO [dbo].[Version]
//			(ProductUID, UID, VersionName, VersionDescribing)
//		    VALUES ('2007022313264471fc32', '200702231608482c9dff', 'TestProduct-TestVersion', '测试版本')
//		GO

}
